<?php

use \yii\helpers\ArrayHelper;

$customMenu = include __DIR__ . "/menu-project.php";

$defaultMenuItems = [
    [
        'label' => '系统配置',
        'url' => ['/setting'],
        'icon' => 'fa fa-cog',
        'auth'=> [
            'module:setting',
        ]
    ],
];


if (!empty($customMenu))
{
    $menuItems = ArrayHelper::merge($customMenu, $defaultMenuItems);
}

$dashboard = [
    'label' => $this->t('Dashboard'),
    'url' => Yii::$app->homeUrl,
    'icon' => 'fa-dashboard',
    'active' => Yii::$app->request->url === Yii::$app->homeUrl
];

array_unshift($dashboard,$menuItems);

return $menuItems;
